package com.minelx.table.core;

import java.util.Objects;

public final class Intersection {
	private final long left;
	private final long right;

	public Intersection(long left, long right) {
		this.left = left;
		this.right = right;
	}

	public long left() {
		return left;
	}

	public long right() {
		return right;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == this) return true;
		if (obj == null || obj.getClass() != this.getClass()) return false;
		Intersection that = (Intersection) obj;
		return this.left == that.left &&
				this.right == that.right;
	}

	@Override
	public int hashCode() {
		return Objects.hash(left, right);
	}

	@Override
	public String toString() {
		return "Intersection[" +
				"left=" + left + ", " +
				"right=" + right + ']';
	}
}
